---
title: Habitat - Demo - Configure the Service Through Discovery
description: The “Try Habitat” is an interactive, in-browser demo that walks you through how to build, configure, and run packages in Habitat.
step: 5
total_steps: 7
---
h2.page-body--title Configure the Service Through Discovery

p
  | We've updated our config file with the new setting. At this point you would
    typically be faced with the hectic, time-consuming task of rolling this change
    out to all of your nodes.
p
  | Imagine, for a moment, if you could simply apply the change in a single command
    with each node picking it up automatically&hellip; imagine no more! The Habitat
    supervisor has it under control so that you can quickly update the entire group.
p
  | Before we dive into the topic of setting up groups, let's presume
    you've already got a large service group up and running which contains many
    database instances.
p
  | Note that the TCP backlog warning is present in the two sample running nodes.
    Now, go ahead and apply the updated config.toml file by uploading it to one of the
    nodes in our service group. Then watch the magic happen as the peers discover
    and apply the change, clearing the TCP backlog issue.

code
  | hab config apply redis.default 1 /tmp/config.toml --peer 172.17.0.4

.window-buttons
  ul
    li
      a.button.secondary.active data-target="window-node-1" Terminal
    li
      a.button.secondary data-target="window-node-2" Service group node 1 - <span class="node-status">running</span> <span class="button-badge">&nbsp;</span>
    li
      a.button.secondary data-target="window-node-3" Service group node 2 - <span class="node-status">running</span> <span class="button-badge">&nbsp;</span>

#window-node-1.window-node
  = partial "partials/terminal" do

.shell-panel.window-node id="window-node-2" style="display:none;"
  pre
    | # node is up and running as leader
      redis(SV): Starting
      hab-sup(TL): Starting election
      redis(O):                 _._
      redis(O):            _.-``__ ''-._
      redis(O):       _.-``    `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit
      redis(O):   .-`` .-```.  ```\/    _.,_ ''-._
      redis(O):  (    '      ,       .-`  | `,    )     Running in standalone mode
      redis(O):  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
      redis(O):  |    `-._   `._    /     _.-'    |     PID: 102
      redis(O):   `-._    `-._  `-./  _.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |           http://redis.io
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):       `-._    `-.__.-'    _.-'
      redis(O):           `-._        _.-'
      redis(O):               `-.__.-'
      redis(O):
      redis(O): 102:M 04 May 14:24:35.064 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
      redis(O): 102:M 04 May 14:24:35.064 # Server started, Redis version 3.0.7
      redis(O): 102:M 04 May 14:24:35.064 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
      redis(O): 102:M 04 May 14:24:35.064 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
      redis(O): 102:M 04 May 14:24:35.064 * DB loaded from disk: 0.000 seconds
      redis(O): 102:M 04 May 14:24:35.064 * The server is now ready to accept connections on port 6379
      hab-sup(TP): Writing our census rumor: CensusEntry {
          id: Uuid("8ac879b2-5ccb-4e6b-98ff-787bbba28652"),
          member_id: Uuid("52334bd4-db51-49e3-9be4-db4f01fbfc8a"),
          hostname: "6e3eb7656372",
          ip: "172.17.0.4",
          suitability: 0,
          port: Some(
              "6379"
          ),
          exposes: Some(
              [
                  "6379"
              ]
          ),
          leader: true,
          follower: false,
          data_init: false,
          vote: None,
          election: None,
          needs_write: Some(
              true
          ),
          initialized: true,
          keep_me: true,
          service: "redis",
          group: "default",
          alive: true,
          suspect: false,
          confirmed: false,
          detached: false,
          incarnation: LamportClock {
              counter: 4
          }
      }
      redis(O): 102:M 04 May 14:24:41.200 * Slave 172.17.0.7:6379 asks for synchronization
      redis(O): 102:M 04 May 14:24:41.200 * Full resync requested by slave 172.17.0.7:6379
      redis(O): 102:M 04 May 14:24:41.200 * Starting BGSAVE for SYNC with target: disk
      redis(O): 102:M 04 May 14:24:41.203 * Background saving started by pid 109
      redis(O): 109:C 04 May 14:24:41.211 * DB saved on disk
      redis(O): 109:C 04 May 14:24:41.211 * RDB: 6 MB of memory used by copy-on-write
      redis(O): 102:M 04 May 14:24:41.301 * Background saving terminated with success
      redis(O): 102:M 04 May 14:24:41.303 * Synchronization with slave 172.17.0.7:6379 succeeded
  pre.full-output
    | Writing new config file from gossip: /hab/svc/redis/gossip.toml
      hab-sup(SC): Updated redis.config
      redis(SV): Stopping
      redis(O): 102:signal-handler (1462372118) Received SIGTERM scheduling shutdown...
      redis(O): 102:M 04 May 14:28:38.723 # User requested shutdown...
      redis(O): 102:M 04 May 14:28:38.723 # There is a child saving an .rdb. Killing it!
      redis(O): 102:M 04 May 14:28:38.723 * Saving the final RDB snapshot before exiting.
      redis(O): 102:M 04 May 14:28:38.728 * DB saved on disk
      redis(O): 102:M 04 May 14:28:38.728 # Redis is now ready to exit, bye bye...
      hab-sup(SV): redis - process 102 died with exit code 0
      hab-sup(SV): redis - Service exited
      redis(SV): Starting
      redis(O):                 _._
      redis(O):            _.-``__ ''-._
      redis(O):       _.-``    `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit
      redis(O):   .-`` .-```.  ```\/    _.,_ ''-._
      redis(O):  (    '      ,       .-`  | `,    )     Running in standalone mode
      redis(O):  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
      redis(O):  |    `-._   `._    /     _.-'    |     PID: 114
      redis(O):   `-._    `-._  `-./  _.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |           http://redis.io
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):       `-._    `-.__.-'    _.-'
      redis(O):           `-._        _.-'
      redis(O):               `-.__.-'
      redis(O):
      redis(O): 114:M 04 May 14:28:38.744 # Server started, Redis version 3.0.7
      redis(O): 114:M 04 May 14:28:38.744 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
      redis(O): 114:M 04 May 14:28:38.744 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
      redis(O): 114:M 04 May 14:28:38.744 * DB loaded from disk: 0.000 seconds
      redis(O): 114:M 04 May 14:28:38.744 * The server is now ready to accept connections on port 6379
      redis(O): 114:M 04 May 14:28:40.111 * Slave 172.17.0.7:6379 asks for synchronization
      redis(O): 114:M 04 May 14:28:40.111 * Full resync requested by slave 172.17.0.7:6379
      redis(O): 114:M 04 May 14:28:40.111 * Starting BGSAVE for SYNC with target: disk
      redis(O): 114:M 04 May 14:28:40.112 * Background saving started by pid 121
      redis(O): 121:C 04 May 14:28:40.119 * DB saved on disk
      redis(O): 121:C 04 May 14:28:40.119 * RDB: 6 MB of memory used by copy-on-write
      redis(O): 114:M 04 May 14:28:40.129 * Background saving terminated with success
      redis(O): 114:M 04 May 14:28:40.134 * Synchronization with slave 172.17.0.7:6379 succeeded

.shell-panel.window-node id="window-node-3" style="display:none;"
  pre
    | # node is up and running as follower
      redis(SV): Starting
      hab-sup(TP): Writing our census rumor: CensusEntry {
          id: Uuid("5a9121b2-81c4-461a-b180-147bd0799623"),
          member_id: Uuid("d1d1f6b7-91c2-4c11-bafb-34647ea28184"),
          hostname: "4fb92d1c6364",
          ip: "172.17.0.7",
          suitability: 0,
          port: Some(
              "6379"
          ),
          exposes: Some(
              [
                  "6379"
              ]
          ),
          leader: false,
          follower: true,
          data_init: false,
          vote: None,
          election: None,
          needs_write: Some(
              true
          ),
          initialized: true,
          keep_me: true,
          service: "redis",
          group: "default",
          alive: true,
          suspect: false,
          confirmed: false,
          detached: false,
          incarnation: LamportClock {
              counter: 2
          }
      }
      redis(O):                 _._
      redis(O):            _.-``__ ''-._
      redis(O):       _.-``    `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit
      redis(O):   .-`` .-```.  ```\/    _.,_ ''-._
      redis(O):  (    '      ,       .-`  | `,    )     Running in standalone mode
      redis(O):  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
      redis(O):  |    `-._   `._    /     _.-'    |     PID: 94
      redis(O):   `-._    `-._  `-./  _.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |           http://redis.io
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):       `-._    `-.__.-'    _.-'
      redis(O):           `-._        _.-'
      redis(O):               `-.__.-'
      redis(O):
      redis(O): 94:S 04 May 14:24:40.201 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
      redis(O): 94:S 04 May 14:24:40.201 # Server started, Redis version 3.0.7
      redis(O): 94:S 04 May 14:24:40.201 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
      redis(O): 94:S 04 May 14:24:40.202 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
      redis(O): 94:S 04 May 14:24:40.202 * The server is now ready to accept connections on port 6379
      redis(O): 94:S 04 May 14:24:41.198 * Connecting to MASTER 172.17.0.4:6379
      redis(O): 94:S 04 May 14:24:41.198 * MASTER <-> SLAVE sync started
      redis(O): 94:S 04 May 14:24:41.198 * Non blocking connect for SYNC fired the event.
      redis(O): 94:S 04 May 14:24:41.199 * Master replied to PING, replication can continue...
      redis(O): 94:S 04 May 14:24:41.200 * Partial resynchronization not possible (no cached master)
      redis(O): 94:S 04 May 14:24:41.207 * Full resync from master: 949a5e293eaa544427645b4d566cafc53d726416:1
      redis(O): 94:S 04 May 14:24:41.302 * MASTER <-> SLAVE sync: receiving 18 bytes from master
      redis(O): 94:S 04 May 14:24:41.302 * MASTER <-> SLAVE sync: Flushing old data
      redis(O): 94:S 04 May 14:24:41.302 * MASTER <-> SLAVE sync: Loading DB in memory
      redis(O): 94:S 04 May 14:24:41.302 * MASTER <-> SLAVE sync: Finished with success
  pre.full-output
    | Writing new config file from gossip: /hab/svc/redis/gossip.toml
      hab-sup(SC): Updated redis.config
      redis(SV): Stopping
      redis(O): 94:signal-handler (1462372119) Received SIGTERM scheduling shutdown...
      redis(O): 94:S 04 May 14:28:39.096 # User requested shutdown...
      redis(O): 94:S 04 May 14:28:39.096 * Saving the final RDB snapshot before exiting.
      redis(O): 94:S 04 May 14:28:39.099 * DB saved on disk
      redis(O): 94:S 04 May 14:28:39.099 # Redis is now ready to exit, bye bye...
      hab-sup(SV): redis - process 94 died with exit code 0
      hab-sup(SV): redis - Service exited
      redis(SV): Starting
      redis(O):                 _._
      redis(O):            _.-``__ ''-._
      redis(O):       _.-``    `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit
      redis(O):   .-`` .-```.  ```\/    _.,_ ''-._
      redis(O):  (    '      ,       .-`  | `,    )     Running in standalone mode
      redis(O):  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
      redis(O):  |    `-._   `._    /     _.-'    |     PID: 102
      redis(O):   `-._    `-._  `-./  _.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |           http://redis.io
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):  |`-._`-._    `-.__.-'    _.-'_.-'|
      redis(O):  |    `-._`-._        _.-'_.-'    |
      redis(O):   `-._    `-._`-.__.-'_.-'    _.-'
      redis(O):       `-._    `-.__.-'    _.-'
      redis(O):           `-._        _.-'
      redis(O):               `-.__.-'
      redis(O):
      redis(O): 102:S 04 May 14:28:39.109 # Server started, Redis version 3.0.7
      redis(O): 102:S 04 May 14:28:39.109 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
      redis(O): 102:S 04 May 14:28:39.109 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
      redis(O): 102:S 04 May 14:28:39.109 * DB loaded from disk: 0.000 seconds
      redis(O): 102:S 04 May 14:28:39.110 * The server is now ready to accept connections on port 6379
      redis(O): 102:S 04 May 14:28:40.106 * Connecting to MASTER 172.17.0.4:6379
      redis(O): 102:S 04 May 14:28:40.106 * MASTER <-> SLAVE sync started
      redis(O): 102:S 04 May 14:28:40.106 * Non blocking connect for SYNC fired the event.
      redis(O): 102:S 04 May 14:28:40.111 * Master replied to PING, replication can continue...
      redis(O): 102:S 04 May 14:28:40.111 * Partial resynchronization not possible (no cached master)
      redis(O): 102:S 04 May 14:28:40.115 * Full resync from master: db96a202d54304c7075a2665a917fae465a5b96e:1
      redis(O): 102:S 04 May 14:28:40.129 * MASTER <-> SLAVE sync: receiving 18 bytes from master
      redis(O): 102:S 04 May 14:28:40.133 * MASTER <-> SLAVE sync: Flushing old data
      redis(O): 102:S 04 May 14:28:40.133 * MASTER <-> SLAVE sync: Loading DB in memory
      redis(O): 102:S 04 May 14:28:40.134 * MASTER <-> SLAVE sync: Finished with success

#success
  = partial "partials/advance_button" do
    | Next - Set up a service group

= partial "partials/previous_button" do
  | Back to previous step
